<!--
 * @Date: 2020-07-31 22:26:00
 * @名称: 图片管理
 * @版本: 0.01
 * @作者: 初雪桜
 * @邮箱: 202184199@qq.com
 * @最后编辑: 初雪桜
 * @LastEditTime: 2020-08-05 16:56:35
 * @FilePath: /服务器/app/useradmin/view/DataOptimization/FileManagementController/index.html
-->
<html>

<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
    <title>图片管理</title>
    <link rel="stylesheet" type="text/css" href="/static/admin/layui/css/layui.css">
    <link rel="stylesheet" type="text/css" href="/static/admin/css/admin.css">
    <script src="/public/static/admin/js/jquery.js"></script>
    <script src="/public/static/button.js" type="text/javascript" charset="utf-8"> </script>
</head>

<body>
    <div class="layui-tab page-content-wrap">
        <div style="text-align: center;">当前状态: {$state} </div>
        <ul class="layui-tab-title">
            <li class="layui-this">多余文件</li>
            <li class="">丢失文件</li>
            <li class="">正常文件</li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <form onsubmit="return false;" class="layui-form">

                    <div class="layui-form" id="table-list">
                        <table class="layui-table" lay-even="" lay-skin="nob">
                            <colgroup>
                                <col width="50">
                                <col class="hidden-xs" width="50">
                                <col class="hidden-xs" width="100">
                                <col>
                                <col class="hidden-xs" width="150">
                                <col class="hidden-xs" width="150">
                                <col width="80">
                                <col width="150">
                            </colgroup>
                            <thead>
                                <tr>
                                    <th class="hidden-xs">ID</th>
                                    <th class="hidden-xs">文件名</th>
                                    <th>图片</th>
                                    <th class="hidden-xs">上传时间</th>
                                    <th class="hidden-xs">最后一次读取时间</th>
                                    <th class="hidden-xs">路径</th>
                                    <th>大小</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>

                                {volist name='$imageFileList' id='vo'}
                                <!-- {:$tableName = $key."/";} -->
                                <!-- 循环大类 -->
                                {volist name='vo' id='userVo'}
                                <!-- {:$userName = $tableName.$key."/";} -->
                                <!-- 上传的用户列表 -->
                                {volist name='userVo' id='bookVo'}
                                <!-- {:$bookName = $userName.$key."/";} -->
                                <!-- 书籍列表 丢失的 -->
                                {volist name='bookVo' id='projectVo'}
                                <!-- {:$projectName = $bookName.$key."/";} -->
                                <!-- 分卷 -->
                                {volist name='projectVo' id='imageVo' key = 'imageKey'}
                                <!-- 当前分卷丢失的图片 -->
                                <tr name="{:$imageVo.fileSrc;}">
                                    <td class="hidden-xs">{$imageKey}</td>
                                    <td class="hidden-xs">{$key}</td>
                                    <td>
                                        <img width="150" src="/public/{:$imageVo.fileSrc;}">
                                    </td>
                                    <td class="hidden-xs">{:$imageVo.fileUpdateTime;}</td>
                                    <td class="hidden-xs">{:$imageVo.fileReadTime;}</td>
                                    <td class="hidden-xs" onclick="alert('{:$imageVo.fileSrc;}')">路径过长点击查看</td>
                                    <td>{:$imageVo.fileSize;}</td>
                                    <td>
                                        <div class="layui-inline" data-images-src="{:$imageVo.fileSrc;}">
                                            <button title="删除"
                                                class="layui-btn layui-btn-small layui-btn-danger delete-images">
                                                <i class="layui-icon"></i>
                                            </button>
                                        </div>
                                    </td>
                                </tr>
                                {/volist}
                                <!-- 循环大类 -->
                                {/volist}
                                <!-- 上传的用户列表 -->
                                {/volist}
                                <!-- 书籍列表 丢失的 -->
                                {/volist}
                                <!-- 分卷 -->
                                {/volist}
                                <!-- 当前分卷丢失的图片 -->
                            </tbody>
                        </table>
                    </div>

                </form>
            </div>
            <!-- 文件不存在 -->
            <div class="layui-tab-item">
                <form class="layui-form" onsubmit="return false;">
                    <div class="layui-form" id="table-list">
                        <table class="layui-table" lay-even="" lay-skin="nob">
                            <colgroup>
                                <col width="50">
                                <col class="hidden-xs" width="50">
                                <col class="hidden-xs" width="100">
                                <col>
                                <col class="hidden-xs" width="150">
                                <col class="hidden-xs" width="150">
                                <col width="80">
                                <col width="150">
                            </colgroup>
                            <thead>
                                <tr>
                                    <th class="hidden-xs">ID</th>
                                    <th class="hidden-xs">文件名</th>
                                    <th class="hidden-xs">路径</th>
                                    <th>状态</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>

                                {volist name='$fileMissing' id='vo'}
                                <!-- {:$tableName = $key;} -->
                                <!-- {:$url = $key."/";} -->
                                <!-- 循环大类 -->
                                {volist name='vo' id='userVo'}
                                <!-- {:$userName = $key;} -->
                                <!-- {:$url = $url.$key."/";} -->
                                <!-- 上传的用户列表 -->
                                {volist name='userVo' id='bookVo'}
                                <!-- {:$bookName = $key;} -->
                                <!-- {:$url = $url.$key."/";} -->
                                <!-- 书籍列表 丢失的 -->
                                {volist name='bookVo' id='projectVo'}
                                <!-- {:$projectName = $key;} -->
                                <!-- {:$url = $url.$key."/";} -->
                                <!-- 分卷 -->
                                {volist name='projectVo' id='imageVo' key = 'imageKey'}
                                <!-- {:$url = $url.$key;} -->
                                <tr>
                                    <td class="hidden-xs">{$imageKey}</td>
                                    <td class="hidden-xs">{$key}</td>
                                    <td class="hidden-xs">{$url}</td>
                                    <td class="hidden-xs" style="color: red;">已丢失</td>
                                    <td>
                                        <div class="layui-inline" data-images-src="public/update/imagesupdate/{$url}">
                                            <button title="删除"
                                                class="layui-btn layui-btn-small layui-btn-danger delete-missing-files">
                                                <i class="layui-icon"></i>
                                            </button>
                                            <button title="编辑分卷" data-project-id="{$bookName}"
                                                data-book-id="{$userName}"
                                                class="layui-btn layui-btn-small layui-btn-normal bottin-comics-son-project">
                                                <i class="layui-icon">&#xe642;</i>
                                            </button>
                                        </div>
                                    </td>
                                </tr>
                                {/volist}
                                <!-- 循环大类 -->
                                {/volist}
                                <!-- 上传的用户列表 -->
                                {/volist}
                                <!-- 书籍列表 丢失的 -->
                                {/volist}
                                <!-- 分卷 -->
                                {/volist}
                                <!-- 当前分卷丢失的图片 -->
                            </tbody>
                        </table>
                    </div>
                </form>
            </div>
            <!-- 正常文件 -->
            <div class="layui-tab-item">
                <form onsubmit="return false;" class="layui-form">
                    <div class="layui-form" id="table-list">
                        <table class="layui-table" lay-even="" lay-skin="nob">
                            <colgroup>
                                <col width="50">
                                <col class="hidden-xs" width="50">
                                <col class="hidden-xs" width="100">
                                <col>
                                <col class="hidden-xs" width="150">
                                <col class="hidden-xs" width="150">
                                <col width="80">
                                <col width="150">
                            </colgroup>
                            <thead>
                                <tr>
                                    <th class="hidden-xs">ID</th>
                                    <th class="hidden-xs">文件名</th>
                                    <th>图片</th>
                                    <th class="hidden-xs">上传时间</th>
                                    <th class="hidden-xs">最后一次读取时间</th>
                                    <th class="hidden-xs">路径</th>
                                    <th>大小</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>

                                {volist name='$TheFileIsNormal' id='vo'}
                                <!-- {:$tableName = $key."/";} -->
                                <!-- 循环大类 -->
                                {volist name='vo' id='userVo'}
                                <!-- {:$userName = $tableName.$key."/";} -->
                                <!-- 上传的用户列表 -->
                                {volist name='userVo' id='bookVo'}
                                <!-- {:$bookName = $userName.$key."/";} -->
                                <!-- 书籍列表 丢失的 -->
                                {volist name='bookVo' id='projectVo'}
                                <!-- {:$projectName = $bookName.$key."/";} -->
                                <!-- 分卷 -->
                                {volist name='projectVo' id='imageVo' key = 'imageKey'}
                                <!-- 当前分卷丢失的图片 -->
                                <tr name="{:$imageVo.fileSrc;}">
                                    <td class="hidden-xs">{$imageKey}</td>
                                    <td class="hidden-xs">{$key}</td>
                                    <td>
                                        <img width="150" src="/public/{:$imageVo.fileSrc;}">
                                    </td>
                                    <td class="hidden-xs">{:$imageVo.fileUpdateTime;}</td>
                                    <td class="hidden-xs">{:$imageVo.fileReadTime;}</td>
                                    <td class="hidden-xs" onclick="alert('{:$imageVo.fileSrc;}')">路径过长点击查看</td>
                                    <td>{:$imageVo.fileSize;}</td>
                                    <td>
                                        <div class="layui-inline" data-images-src="{:$imageVo.fileSrc;}">
                                            <button title="删除"
                                                class="layui-btn layui-btn-small layui-btn-danger delete-images">
                                                <i class="layui-icon"></i>
                                            </button>
                                        </div>
                                    </td>
                                </tr>
                                {/volist}
                                <!-- 循环大类 -->
                                {/volist}
                                <!-- 上传的用户列表 -->
                                {/volist}
                                <!-- 书籍列表 丢失的 -->
                                {/volist}
                                <!-- 分卷 -->
                                {/volist}
                                <!-- 当前分卷丢失的图片 -->
                            </tbody>
                        </table>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <script src="../../static/admin/layui/layui.js" type="text/javascript" charset="utf-8"></script>
    <script>
        var controller = "/useradmin/"; //当前控制器路径
        layui.use(['form', 'element'], function () { });
        $(document).on("click", "button.delete-images", function () {
            imageSrc = $(this).parent().attr('data-images-src');
            $.ajax({
                type: "POST",
                dataType: "json",
                url: "{$url}useradmin/DataOptimization/FileManagementController/deleteRedundantDocuments",
                data: {
                    "imageSrc": imageSrc,
                },
                success: function (response) {

                }
            });
        });

        $(document).on("click", "button.delete-missing-files", function () {
            imageSrc = $(this).parent().attr('data-images-src');
            $.ajax({
                type: "POST",
                dataType: "json",
                url: "{$url}useradmin/DataOptimization/FileManagementController/DeleteMissingFiles",
                data: {
                    "imageSrc": imageSrc,
                },
                success: function (response) {

                }
            });
        });
        $(document).on("click", "button.edit-project", function () {
            imageSrc = $(this).parent().attr('data-images-src');
            $.ajax({
                type: "POST",
                dataType: "json",
                url: "{$url}useradmin/DataOptimization/FileManagementController/DeleteMissingFiles",
                data: {
                    "imageSrc": imageSrc,
                },
                success: function (response) {

                }
            });
        });
    </script>
</body>

</html>